<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>BMAdmin</title>
    <!-- Tell the browser to be responsive to screen width -->
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
    <!-- Bootstrap 3.3.6 -->
    <link rel="stylesheet" href="../../bootstrap/css/bootstrap.min.css">
    <!-- Font Awesome -->
    <link rel="stylesheet" href="https://cdn.bootcss.com/font-awesome/4.5.0/css/font-awesome.min.css">
    <!-- Ionicons -->
    <link rel="stylesheet" href="https://cdn.bootcss.com/ionicons/2.0.1/css/ionicons.min.css">
    <!-- Theme style -->
    <link rel="stylesheet" href="../../dist/css/AdminLTE.min.css">
    <!-- AdminLTE Skins. Choose a skin from the css/skins
         folder instead of downloading all of them to reduce the load. -->
    <link rel="stylesheet" href="../../dist/css/skins/skin-blue-light.css">

    <link rel="stylesheet" href="../../plugins/fileupload/css/demo.css"/>
    <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
    <script src="https://cdn.bootcss.com/html5shiv/3.7.3/html5shiv.min.js"></script>
    <script src="https://cdn.bootcss.com/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->

    <style>
        .file {
            position: relative;
            display: inline-block;
            background: #4c7bff;
            border: 1px solid #99D3F5;
            border-radius: 4px;
            padding: 4px 12px;
            overflow: hidden;
            color: white;
            text-decoration: none;
            text-indent: 0;
            line-height: 20px;
            float: left;
            margin-top: 10px;
            height: 34px;
            width: 82px;
        }
        .file input {
            position: absolute;
            font-size: 100px;
            right: 0;
            top: 0;
            opacity: 0;
            height: 34px;
            width: 82px;
        }
        .file:hover {
            background: #AADFFD;
            border-color: #78C3F3;
            color: #004974;
            text-decoration: none;
        }

    </style>

</head>
<body class="hold-transition skin-blue-light sidebar-mini">
<!-- Site wrapper -->
<div class="wrapper">

    <header class="main-header">
        <!-- Logo -->
        <a href="../../index2.html" class="logo">
            <!-- mini logo for sidebar mini 50x50 pixels -->
            <span class="logo-mini"><b>BM</b></span>
            <!-- logo for regular state and mobile devices -->
            <span class="logo-lg"><b>BMAdmin o(*￣3￣)o  </b></span>
        </a>
        <!-- Header Navbar: styo(*￣3￣)o le can be found in header.less -->
        <nav class="navbar navbar-static-top">
            <!-- Sidebar toggle button-->
            <a href="#" class="sidebar-toggle" data-toggle="offcanvas" role="button">
                <span class="sr-only">Toggle navigation</span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </a>

            <div class="navbar-custom-menu">
                <ul class="nav navbar-nav">

                    <!-- User Account: style can be found in dropdown.less -->
                    <li class="dropdown user user-menu">
                        <a href="#" class="dropdown-toggle" data-toggle="dropdown">
                            <span class="hidden-xs">注册</span>
                        </a>
                    </li>
                    <li class="dropdown user user-menu">
                        <a href="#" class="dropdown-toggle" data-toggle="dropdown">
                            <span class="hidden-xs">登陆</span>
                        </a>
                    </li>
                    <!-- Control Sidebar Toggle Button -->
                    <li>
                        <a href="#" data-toggle="control-sidebar"><i class="fa fa-gears"></i></a>
                    </li>
                </ul>
            </div>
        </nav>
    </header>

    <!-- =============================================== -->

    <aside class="main-sidebar">
        <section class="sidebar">
            <ul class="sidebar-menu"></ul>
        </section>
    </aside>

    <!-- =============================================== -->

    <!-- Content Wrapper. Contains page content -->
    <div class="content-wrapper">
        <section class="content-header">
            <h1>
                用户编码转换
            </h1>
            <ol class="breadcrumb">
                <li><a href="#"><i class="fa fa-dashboard"></i> 专用工具</a></li>
                <li class="active"><a href="#">用户编码转换</a></li>
            </ol>
        </section>
        <!--<div class="up_load_file">-->
        <!--</div>-->

        <div id="ControlsRow" style="padding: 5px 0px 10px 15px" >
            <input type="Button" class="btn btn-success" value="模板下载" onclick="get_example()" style="margin: 10px 10px 0px 0px;float: left"/>

            <form  class="form-inline" id="uploadForm" >
                <a href="javascript:;" class="file"><p style="padding-top: 2px">选择文件</p>
                    <input type="file" name="file" >
                </a>
            </form>
            <input type="button" value="上传文件" class="btn btn-info" style="margin: 10px 0px 0px 10px ;float: left" onclick="doUpload()">


            <input type="Button" class="btn btn-success" value="开始转换" onclick="getSpbmResult()" style="margin: 10px 0px 0px 10px;float: left"/>
        </div>


        <div style="padding-left: 17px;padding-top: 60px">
            <h4 >使用说明：</h4>

            功能：将整理好的excel 转换成 甬航开票系统客户编码导入格式。<br/>使用方法如下：
            <ol style="padding-left: 15px">
                <li><b>下载模板</b>，按照模板格式整理客户信息，最后一栏0代表true，1代表false</li>
                <li>点击<b>选择文件</b>，选择整理好的文件，注意：<b>只支持xlsx 结尾文件</b></li>
                <li>点击<b>上传文件</b>，响应速度根据数据多少有关，<b>请勿多次点击</b></li>
                <li>当提示<b>上传成功</b>后，点击<b>开始转换</b>，转换完成后自动下载数据，相应速度跟数据量有关，<b>请勿多次点击</b></li>
                <li>如果遇到上传失败，请检查excel相应行数据，修改相关数据为 <b>正确格式</b> 后再次选中并上传</li>
            </ol>

        </div>
    </section>
    <!-- /.content -->
</div>
<!-- /.content-wrapper -->

<footer class="main-footer">
    <div class="pull-right hidden-xs">
        <b>Version</b> beta 1.0
    </div>
    <strong>Copyright &copy; 2017-2018 <a href="http://www.bmadmin.com">BM Admin</a>.</strong> Power By Bomber
</footer>

<div class="control-sidebar-bg"></div>
</div>
<!-- ./wrapper -->

<!-- jQuery 2.2.3 -->
<script src="../../plugins/jQuery/jquery-2.2.3.min.js"></script>
<!-- Bootstrap 3.3.6 -->
<script src="../../bootstrap/js/bootstrap.min.js"></script>
<!-- SlimScroll -->
<script src="../../plugins/slimScroll/jquery.slimscroll.min.js"></script>
<!-- FastClick -->
<script src="../../plugins/fastclick/fastclick.js"></script>
<!-- AdminLTE App -->
<script src="../../dist/js/app.min.js"></script>
<!-- AdminLTE for demo purposes -->
<script src="../../dist/js/demo.js"></script>
<script src="../../dist/js/base.js"></script>

<script src="../../plugins/fileupload/js/uploadfile.js"></script>
<script>


    function get_example() {
        window.location.href = "/bmadmin/aisino/khbm/exampleDownload";
    }

    function getSpbmResult() {
        window.location.href = "/bmadmin/aisino/khbm/getspbmtxt";
    }

    function doUpload() {
        var formData = new FormData($( "#uploadForm" )[0]);
        $.ajax({
            url: '/bmadmin/aisino/khbm/fileupload' ,
            type: 'POST',
            data: formData,
            async: false,
            cache: false,
            contentType: false,
            processData: false,
            success: function (returndata) {
                alert(returndata.message);
            },
            error: function (returndata) {
                alert(returndata);
            }
        });
    }

</script>
</body>
</html>
